import { Component } from '@angular/core';
import {  NavController, NavParams, Events, ToastController } from 'ionic-angular';
import { Storage } from '@ionic/storage/dist';
import { ButtonService } from '../../providers/button.service';

@Component({
  selector: 'page-test',
  templateUrl: 'test.html',

})
export class TestPage {
  // @ViewChild('txtView') txtView;
  // @ViewChild('musicCard') musicCard;
  // @ViewChild('navData') navData;


  // navRightData = { "ssss": "sss" };



  // track = {
  //   "id": "ssss",
  //   "name": "啊啊啊啊",
  //   "src": "assets/imgs/img/music/mp3/Booty Music - Git Fresh.mp3",
  //   "artistsName": "ssss ",
  //   "albumName": "展示柜",
  //   "albumImages": "assets/imgs/img/music/tili.png",
  //   "duration_ms": 500
  // }

  // musicList: Array<MusicList>;

  // inputTxt;
  // progress;
  // ifPlaying = false;
  // isFavorite = false;
  // favoriteIcon = 'star-outline';
  // // player: Howl;
  // isSeeking: boolean = false;

  constructor(
    public nav: NavController,
    public params: NavParams,
    public events: Events,
    public storage: Storage,
    public btnSer: ButtonService,
    public toastCtrl: ToastController
  ) {
    // this.storage.get(this.track.id).then((res) => {
    //   let ss = true;
    //   if (!ss) {
    //     this.isFavorite = false;
    //     this.favoriteIcon = 'star-outline';
    //   } else {
    //     this.isFavorite = true;
    //     this.favoriteIcon = 'star';
    //   }
    // });

    // this.musicList = [
    //   {
    //     id: "ssss",
    //     "name": "啊啊啊啊",
    //     "src": "assets/imgs/img/music/mp3/Booty Music - Git Fresh.mp3",
    //     "artistsName": "ssss ",
    //     "albumName": "展示柜",
    //     "albumImages": "assets/imgs/img/music/tili.png",
    //     "duration_ms": 500
    //   },
    //   {
    //     id: "ssss",
    //     "name": "啊啊啊啊",
    //     "src": "assets/imgs/img/music/mp3/Booty Music - Git Fresh.mp3",
    //     "artistsName": "ssss ",
    //     "albumName": "展示柜",
    //     "albumImages": "assets/imgs/img/music/tili.png",
    //     "duration_ms": 500
    //   }
    //   , {
    //     id: "ssss",
    //     "name": "啊啊啊啊",
    //     "src": "assets/imgs/img/music/mp3/Booty Music - Git Fresh.mp3",
    //     "artistsName": "ssss ",
    //     "albumName": "展示柜",
    //     "albumImages": "assets/imgs/img/music/tili.png",
    //     "duration_ms": 500
    //   }

    // ]
  };





  // toggleFavorites() {
  //   let addedToast = {
  //     message: 'Song added to Favorites',
  //     duration: 3000,
  //     position: 'bottom'
  //   };
  //   let removedToast = {
  //     message: 'Song remove to Favorites',
  //     duration: 3000,
  //     position: 'bottom'
  //   };
  //   if (!this.isFavorite) {
  //     let toast = this.toastCtrl.create(addedToast);
  //     toast.present();
  //     this.isFavorite = true;
  //     this.favoriteIcon = 'star';
  //     this.storage.set(this.track.id, this.track);
  //     this.events.publish('songAdded', this.track);
  //   } else {
  //     let toast = this.toastCtrl.create(removedToast);
  //     toast.present();
  //     this.storage.remove(this.track.id);
  //     this.isFavorite = false;
  //     this.favoriteIcon = 'star-outline';
  //     this.events.publish('songRemoved', this.track);
  //   }
  // }

  // ionViewWillLeave() {
  //   this.musicCard.stopSong()
  // }

  // setThisSong(item) {
  //   this.track = {
  //     id: item.id,
  //     "name": item.name,
  //     "src": "assets/imgs/img/music/mp3/Booty Music - Git Fresh.mp3",
  //     "artistsName": item.artistsName,
  //     "albumName": item.albumName,
  //     "albumImages": item.imgs,
  //     "duration_ms": 500
  //   }



  // }

  btn1() {

  }

}
// export class MusicList {
//   constructor(
//     public id: string,
//     public name: string,
//     public src: string,
//     public albumName: string,
//     public albumImages: String,
//     public artistsName: string,
//     public duration_ms: number
//   ) {
//   }

// }